package com.sense.kukoo.common.repo.kv.playlist_position

import com.sense.kukoo.common.repo.kv.KukooKeyValueManager
import com.sense.kukoo.common.repo.kv.login_history.LoginHistory
import com.tencent.mmkv.MMKV

class PlaylistPositionImpl(val mmkv: MMKV) {

    private var position: Int

    init {
        position = mmkv.decodeInt(KukooKeyValueManager.KEY_PLAYLIST_POSITION, 0)
    }

    fun set(p: Int) {
        position = p
        mmkv.encode(KukooKeyValueManager.KEY_PLAYLIST_POSITION, position)
    }

    fun get(): Int = position
}